package com.thelocal;

import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;
import org.beetl.sql.core.annotatoin.Sql;
import org.beetl.sql.core.annotatoin.Table;
import org.beetl.sql.core.engine.Page;
import org.beetl.sql.experimental.iohao.core.ActiveRecord;
import org.beetl.sql.experimental.iohao.core.MyMapper;

import static org.beetl.sql.experimental.iohao.core.SqlKit.mapper;

/**
 * create time : 2017-05-26 15:55
 *
 * @author luoyizhu@gmail.com
 */
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
//@Accessors(chain = true) // 链式编程
@Table(name = "tb_bird")
public class Fuck implements ActiveRecord {
    int id;
    /** 年龄 */
    Integer age;
    /** 名字 */
    String name;
    /** 描述 */
    String description;

    public interface Dao extends MyMapper<Fuck> {
        Dao $ = mapper(Dao.class);

        Page<Fuck> pageByAge(int pageNumber, int pageSize, int age);

        @Sql("select * from tb_bird where age = ?")
        Page<Fuck> pageByAgeSql(int pageNumber, int pageSize, int age);

        Page<Integer> pageIdByAge(int pageNumber, int age);

    }

}
